<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{completed:item.isDone}" v-for="(item,index) in newIsShowList" :key="index">
      <div class="view" >
        <input v-model="item.isDone" class="toggle" type="checkbox" @input="$store.commit('changeIsDone',index)"/>
        <label>{{item.name}}</label>
        <button class="destroy" @click="$store.commit('delList',index)"></button>
      </div>
    </li>
  </ul>
  
</template> 
<script>
import {  mapState,mapGetters } from 'vuex'
export default {
  
  methods:{

  },
  computed:{
    ...mapState(['list']),
    ...mapGetters(['newIsShowList'])
    
  }
}
</script>
